﻿<%@ WebHandler Language="C#" Class="lang" %>

using System;
using System.Web;
//
using jtbc;
using jtbc.plus;

public class lang : IHttpHandler 
{
    public void ProcessRequest (HttpContext context)
    {
        string lang = cls.getSafeString(request.querystring("l"));
        string backurl = cls.getSafeString(request.querystring("b"));
        
        if (lang == "english")
        {
            cookies.set("config-language", "english", 999999999);
            config.default_language = "english";
            config.default_template = "tpl_english";
        }
        else
        {
            cookies.set("config-language", "chinese", 999999999);
            config.default_language = "chinese";
            config.default_template = "tpl_default"; 
        }
        
        context.Response.Redirect(backurl);
    }

    public bool IsReusable
    {
        get { return true; }
    }
}
